Optimal. Leaf size=46 \[ -\frac {(a-b) \sin (e+f x) \cos (e+f x)}{2 f}+\frac {1}{2} x (a-3 b)+\frac {b \tan (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3663, 455, 388, 203} \[ -\frac {(a-b) \sin (e+f x) \cos (e+f x)}{2 f}+\frac {1}{2} x (a-3 b)+\frac {b \tan (e+f x)}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 388
Rule 455
Rule 3663
Rubi steps
\begin {align*} \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2 \left (a+b x^2\right )}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {(a-b) \cos (e+f x) \sin (e+f x)}{2 f}-\frac {\operatorname {Subst}\left (\int \frac {-a+b-2 b x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac {(a-b) \cos (e+f x) \sin (e+f x)}{2 f}+\frac {b \tan (e+f x)}{f}+\frac {(a-3 b) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac {1}{2} (a-3 b) x-\frac {(a-b) \cos (e+f x) \sin (e+f x)}{2 f}+\frac {b \tan (e+f x)}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.23, size = 43, normalized size = 0.93 \[ \frac {2 (a-3 b) (e+f x)+(b-a) \sin (2 (e+f x))+4 b \tan (e+f x)}{4 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.42, size = 54, normalized size = 1.17 \[ \frac {{\left (a - 3 \, b\right )} f x \cos \left (f x + e\right ) - {\left ({\left (a - b\right )} \cos \left (f x + e\right )^{2} - 2 \, b\right )} \sin \left (f x + e\right )}{2 \, f \cos \left (f x + e\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.97, size = 395, normalized size = 8.59 \[ \frac {a f x \tan \left (f x\right )^{3} \tan \relax (e)^{3} - 3 \, b f x \tan \left (f x\right )^{3} \tan \relax (e)^{3} + a f x \tan \left (f x\right )^{3} \tan \relax (e) - 3 \, b f x \tan \left (f x\right )^{3} \tan \relax (e) - a f x \tan \left (f x\right )^{2} \tan \relax (e)^{2} + 3 \, b f x \tan \left (f x\right )^{2} \tan \relax (e)^{2} + a f x \tan \left (f x\right ) \tan \relax (e)^{3} - 3 \, b f x \tan \left (f x\right ) \tan \relax (e)^{3} + a \tan \left (f x\right )^{3} \tan \relax (e)^{2} - 3 \, b \tan \left (f x\right )^{3} \tan \relax (e)^{2} + a \tan \left (f x\right )^{2} \tan \relax (e)^{3} - 3 \, b \tan \left (f x\right )^{2} \tan \relax (e)^{3} - a f x \tan \left (f x\right )^{2} + 3 \, b f x \tan \left (f x\right )^{2} + a f x \tan \left (f x\right ) \tan \relax (e) - 3 \, b f x \tan \left (f x\right ) \tan \relax (e) - a f x \tan \relax (e)^{2} + 3 \, b f x \tan \relax (e)^{2} - 2 \, b \tan \left (f x\right )^{3} - 2 \, a \tan \left (f x\right )^{2} \tan \relax (e) - 2 \, a \tan \left (f x\right ) \tan \relax (e)^{2} - 2 \, b \tan \relax (e)^{3} - a f x + 3 \, b f x + a \tan \left (f x\right ) - 3 \, b \tan \left (f x\right ) + a \tan \relax (e) - 3 \, b \tan \relax (e)}{2 \, {\left (f \tan \left (f x\right )^{3} \tan \relax (e)^{3} + f \tan \left (f x\right )^{3} \tan \relax (e) - f \tan \left (f x\right )^{2} \tan \relax (e)^{2} + f \tan \left (f x\right ) \tan \relax (e)^{3} - f \tan \left (f x\right )^{2} + f \tan \left (f x\right ) \tan \relax (e) - f \tan \relax (e)^{2} - f\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.45, size = 81, normalized size = 1.76 \[ \frac {a \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+b \left (\frac {\sin ^{5}\left (f x +e \right )}{\cos \left (f x +e \right )}+\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )-\frac {3 f x}{2}-\frac {3 e}{2}\right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.00, size = 51, normalized size = 1.11 \[ \frac {{\left (f x + e\right )} {\left (a - 3 \, b\right )} + 2 \, b \tan \left (f x + e\right ) - \frac {{\left (a - b\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 11.32, size = 41, normalized size = 0.89 \[ \frac {b\,\mathrm {tan}\left (e+f\,x\right )-\sin \left (2\,e+2\,f\,x\right )\,\left (\frac {a}{4}-\frac {b}{4}\right )+f\,x\,\left (\frac {a}{2}-\frac {3\,b}{2}\right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \sin ^{2}{\left (e + f x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________